home *** CD-ROM | disk | FTP | other *** search
/ Holt Researcher: American History / Holt Researcher: American History.iso / pc / modules / dbtext.dxr / 00018_Button Code.ls < prev    next >
Encoding:
Text File  |  2000-01-18  |  1.6 KB  |  44 lines

  1. global gDBTextVarList
  2.  
  3. on InitButtons EnableScroll
  4.   MyObj = getaProp(gDBTextVarList, GetObjProp())
  5.   ButtonList = GetButtonList(MyObj)
  6.   SpList = GetSpriteList(MyObj)
  7.   cbs = getaProp(SpList, #closeBox)
  8.   mmbs = getaProp(SpList, #MaxMinBox)
  9.   CopyBS = getaProp(SpList, #CopyButton)
  10.   PrintBS = getaProp(SpList, #PrintButton)
  11.   SaveBS = getaProp(SpList, #SaveButton)
  12.   addProp(ButtonList, cbs, new(script("close box"), "close box", "global", cbs, the loc of sprite cbs))
  13.   addProp(ButtonList, mmbs, new(script("max min box"), "min max", "global", mmbs, the loc of sprite mmbs))
  14.   addProp(ButtonList, CopyBS, new(script("copy icon"), "copy", "internal", CopyBS, the loc of sprite CopyBS))
  15.   addProp(ButtonList, PrintBS, new(script("print icon"), "print", "internal", PrintBS, the loc of sprite PrintBS))
  16.   addProp(ButtonList, SaveBS, new(script("save icon"), "save", "internal", SaveBS, the loc of sprite SaveBS))
  17.   SetButtonList(MyObj, ButtonList)
  18.   repeat with rc in ButtonList
  19.     Inscope(rc)
  20.   end repeat
  21.   disable(getaProp(ButtonList, CopyBS))
  22.   EvalDisableScroll(EnableScroll)
  23.   repeat with rc in [cbs, mmbs, PrintBS, SaveBS]
  24.     set the cursor of sprite rc to GetPointingCursor(MyObj)
  25.   end repeat
  26. end
  27.  
  28. on EvalDisableScroll EnableScroll
  29.   MyObj = getaProp(gDBTextVarList, GetObjProp())
  30.   ButtonList = GetButtonList(MyObj)
  31.   SpList = GetSpriteList(MyObj)
  32.   vbs = getaProp(SpList, #VBed)
  33.   nas = getaProp(SpList, #NArrow)
  34.   sas = getaProp(SpList, #SArrow)
  35.   vts = getaProp(SpList, #VThumb)
  36.   repeat with rc in [nas, sas, vts, vbs]
  37.     if EnableScroll then
  38.       Inscope(getaProp(ButtonList, rc))
  39.       next repeat
  40.     end if
  41.     disable(getaProp(ButtonList, rc))
  42.   end repeat
  43. end
  44.